<?php
function tm_template($html,$template='default'){
	global $data;
	$data['template']=$template;
	include TM_LIBS.'smarty'.SLASH.'Smarty.class.php';
	$smarty=new Smarty();
	$smarty->debugging=false;
	$smarty->template_dir=TEMPLATE_DIR.$template;
	//$smarty->cache_dir=CACHE_DIR.'template'.SLASH.$template;
	$smarty->compile_dir=TEMP_DIR.'template'.SLASH.$template;
	$smarty->compile_check=true;
	$smarty->caching=false;
	$smarty->left_delimiter='<%{';
	$smarty->right_delimiter='}%>';
	$smarty->assign('data',$data);
	$smarty->display($html);
	unset($data);
	unset($smarty);
}
?>